/*
 * =====================================================================================
 *
 *       Filename:  vector_insert.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  05/14/2011 07:22:54 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (), 
 *        Company:  
 *
 * =====================================================================================
 */
// inserting into a vector
#include <iostream>

//#include <vector>
#include "Vector.h"
#define vector Vector
using namespace std;

int main ()
{
	vector<int> myvector ((size_t)3,100);
	vector<int>::iterator it;

	it = myvector.begin();
	//it = myvector.insert ( it , 200 );

	myvector.insert (it,(size_t)2,300);

	// "it" no longer valid, get a new one:
	it = myvector.begin();

	vector<int> anothervector ((size_t)2,400);
	myvector.insert (it+2,anothervector.begin(),anothervector.end());

	int myarray [] = { 501,502,503 };
	myvector.insert (myvector.begin(), myarray, myarray+3);

	cout << "myvector contains:";
	for (it=myvector.begin(); it<myvector.end(); it++)
		cout << " " << *it;
	cout << endl;

	return 0;
}
